<?php require('includes/functions.php'); ?>
<!DOCTYPE html>
<html>
	<head>
		<title>Add Employee</title>
		<script type="text/javascript" src="js/functions.js"></script>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		<?php if (isset($_SESSION['error'])): ?>
			<?php echo "Error: ".$_SESSION['error'] ?>
			<?php unset($_SESSION['error']) ?>
		<?php endif ?>
		<?php if (isset($_SESSION['message'])): ?>
			<?php echo $_SESSION['message'] ?>
			<?php unset($_SESSION['message']) ?>
		<?php endif ?>
        <div class="pambalot">
            <div class="left-pane">
                <div class="vertical-table-div">
            		<form name="myform" action="process/add_employee.php" method="POST">
            		<table cellspacing="0" cellpadding="5" border="1" class="vertical-form-table">
            			<tr>
            				<th>Name</th>
            				<td><input name="name" type="text"  /></td>
            			</tr>
            			<tr>
            				<th>Address</th>
            				<td><textarea rows="5" name="address"></textarea></td>
            			</tr>
            			<tr>
            				<th>Contact</th>
            				<td><input name="contact" type="text" /></td>
            			</tr>
            			<tr>
            				<th>Email</th>
            				<td><input name="email" type="text" /></td>
            			</tr>
            			<tr>
            				<th>Gender</th>
            				<td>
            					<label><input checked="checked" type="radio" name="gender" value="male" />Male</label>
            					<label><input type="radio" name="gender" value="female" />Female</label>
            				</td>
            			</tr>
            			<tr>
            				<th>Birthdate</th>
            				<td><?php echo getDateFields() ?></td>
            			</tr>
            			<tr>
            				<th>Department</th>
            				<td><?php echo getDepartmentFields() ?></td>
            			</tr>	
            			<tr>
            				<th>Job</th>
            				<td><?php echo getJobFields() ?></td>
            			</tr>
            			<tr>
            				<th>Status</th>
            				<td><?php echo getJobStatusFields() ?></td>
            			</tr>
            			<tr>
            				<td colspan="2" align="right">
            					<!--<input type="submit" value="Save" />-->
            					<input type="button" value="Save" onclick="checkForSubmit()" />
            					<input type="reset" value="Clear" />
            				</td>
            			</tr>
            		</table>
            		</form>
                </div>
            </div>
            <div class="right-pane">
                <p><input type="button" value="Add Employee" onclick="location.href='add_employee.php'" /></p>
       			<p><input type="button" value="View Logs" onclick="location.href='view_logs.php'" /></p>
            </div>
            <div class="clear"></div>
        </div>
	</body>
</html>